package com.igor.reporting.entities.issue;


import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.tapestry5.beaneditor.NonVisual;

import com.igor.reporting.entities.contactPerson.ContactPerson;
import com.igor.reporting.entities.location.Location;
import com.igor.reporting.entities.problem.Problem;
import com.igor.reporting.entities.solver.Solver;
import com.igor.reporting.model.Priority;
import com.igor.reporting.model.Status;

@Entity
@Table(name = "issues")
public class Issue {

	@Id
	@GeneratedValue
	@NonVisual
	@Column(name = "issue_id")
	private Long id;
	
	@ManyToOne(optional = false)
	@JoinColumn(name = "location_id")
	private Location location;
	
	@ManyToOne(optional = false)
	@JoinColumn(name = "problem_id")
	private Problem problem;
	
	@ManyToOne(optional = false)
	@JoinColumn(name = "solver_id")
	private Solver solver;
	
	@ManyToOne(optional = false)
	@JoinColumn(name = "contact_person_id")
	private ContactPerson contactPerson;
	
	@Column(name = "date")
	private Date date;
	
	
	@Column(name = "priority")
	private Priority priority;
	
	
	
	
	public Problem getProblem() {
		return problem;
	}

	public void setProblem(Problem problem) {
		this.problem = problem;
	}

	public Solver getSolver() {
		return solver;
	}

	public void setSolver(Solver solver) {
		this.solver = solver;
	}

	public ContactPerson getContactPerson() {
		return contactPerson;
	}

	public void setContactPerson(ContactPerson contactPerson) {
		this.contactPerson = contactPerson;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Priority getPriority() {
		return priority;
	}

	public void setPriority(Priority priority) {
		this.priority = priority;
	}

	@Column(name = "status")
	private Status status;

	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Location getLocation() {
		return location;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

}
